// 令牌根据id编码
const jwt = require('jsonwebtoken');
const USER_TOKEN = 'token-qtj-cs'
const token = (id) => {
    console.log(id);
    return jwt.sign({ id }, USER_TOKEN);

}
//根据编码解出对应id
const key = (token) => {
    return jwt.verify(token, USER_TOKEN)

}
module.exports = {
    token,
    key
}
